import { get, postForm, put } from '@/utils/request'

export function getMenusTree() {
  return get('/auth/resource/menu/tree')
}

export function getUserSelfNavMenuTree() {
  return get('auth/resource/menu/self/tree')
}

export function add(data) {
  return postForm('/auth/resource/menu', data)
}

export function del(ids) {
  return postForm('/auth/resource/menu/del/batch', { pkIds: JSON.stringify(ids) })
}

export function edit(data) {
  return put('/auth/resource/menu', data)
}

export default { add, edit, del, getMenusTree }
